home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Forever 4
/
Atari Forever 4.zip
/
Atari Forever 4.iso
/
PD_THEMA
/
BIORHYTM
/
BIORHYTH.PD
/
TAG.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-03-14
|
2KB
|
61 lines
var j,c,t,m : real;
system : integer;
ende : boolean;
begin
ende:=false;
repeat
clrscr;writeln('Wochentagsermittlung (p)88 mkb');
writeln('------------------------------');writeln;
writeln('<- Bitte Jahr eingeben : ');write('..');
readln(c);
if c<0 then ende:=true;
if not ende then begin
writeln('<- Bitte Monat eingeben : ');write('..');
repeat
readln(m);
until (m>0) and (m<13);
writeln('<- Bitte Tag eingeben : ');write('..');
repeat
readln(t);
until (t>0) and (t<32);writeln;
j:=c-int(c/100)*100;
c:=(c-j)/100;
if m<3 then begin
m:=m+12;
j:=j-1;
if j<0 then begin
j:=99;
c:=c-1;
end;
end;
system:=0;
if c*100+j<1582 then system:=1 else
if c*100+j>1582 then system:=2 else
if m<10 then system:=1 else
if m>10 then system:=2 else
if t<5 then system:=1 else
if t>14 then system:=2;
case system of
0 : writeln(' -- Datum hat nicht existiert --');
1 : t:=t+int((m+1)*26/10)+j+int(j/4)+5-c;
2 : t:=t+int((m+1)*26/10)+j+int(j/4)+int(c/4)-2*c;
end;
t:=t-7*int(t/7);
repeat
if t>6 then t:=t-7;
until t<=7;
if (system>0) then
case round(t) of
0 : writeln('-> Samstag');
1 : writeln('-> Sonntag');
2 : writeln('-> Montag');
3 : writeln('-> Dienstag');
4 : writeln('-> Mittwoch');
5 : writeln('-> Donnerstag');
6 : writeln('-> Freitag');
end;
j:=crawcin;
end;
until ende;
end.